public class Test3 {
    public static void main(String[] args) {
        //3.请求出一个数组的和和平均值。(养鸡场)
        int[] arr = {1, 2, 3, 4, 5};
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        System.out.println("数组的和为：" + sum);
        System.out.println("数组的平均值为：" + sum / arr.length);
    }
}
